package com.demo;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: adol book
 * Date: 2022-04-22
 * Time: 8:09
 */
public class Test1 {
    static{
        int x=5;
    }
    static int x,y;
    public static void main(String args[]){
        x--;
        myMethod( );
        System.out.println(x+y+ ++x);
    }
    public static void myMethod( ){
        y=x++ + ++x;
    }

    public static void main2(String[] args) {
       // new Threads4().go();
    }

    public void go() {
        Runnable r = new Runnable() {
            public void run() {
                System.out.print("foo");
            }
        };
        Thread t = new Thread(r);
        t.start();
    }


    public static String func(String str) {
        int[] array = new int[127];
        StringBuilder sb = new StringBuilder();
        for(int i = 0;i < str.length();i++) {
            char ch = str.charAt(i);
            if(array[ch] == 0) {
                sb.append(ch);
                array[ch]=1;
            }
        }
        return sb.toString();
    }

    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        //循环输入-》处理的是多组输入
        while(scan.hasNextLine()) {
            String str = scan.nextLine();
            String ret = func(str);
            System.out.println(ret);
        }
    }
}

